//
//  ViewController.swift
//  Button
//
//  Created by MacPro on 15/11/4.
//  Copyright © 2015年 dev4shane. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    
    @IBOutlet weak var statusLabel: UILabel!
    
    
    @IBAction func buttonPressed(sender:UIButton){
        
        let title = sender.titleForState(.Normal)
        let plainText = "\(title!) button pressed"
        let styledText = NSMutableAttributedString(string: plainText)
        let attributes = [NSFontAttributeName:UIFont.boldSystemFontOfSize(statusLabel.font.pointSize)]
        let nameRange = (plainText as NSString).rangeOfString(title!)
        styledText.setAttributes(attributes, range: nameRange)
        
        statusLabel.attributedText = styledText
        
    }
    
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

